
#!/bin/bash
# --------------------------------------------------
#Author:  以谁为师
#Email:   admin@attacker.club

wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.17-1.el7.x86_64.rpm-bundle.tar 
# 使用nohup 慢慢下...

if [ -f *.x86_64.rpm-bundle.tar ]

yum remove mariadb* -y
# 卸载 mariadb


tar xvf mysql-8.*bundle.tar
yum localinstall *.rpm
# 安装mysql相关包

systemctl start mysqld
# 启动服务

grep 'temporary password' /var/log/mysqld.log
# 查看自动生成的密码


else
  echo "Please download the offline package: https://dev.mysql.com/downloads/mysql/"
  exit 1

fi

